package cn.enilu.flash.bean.entity.house;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/30 15:48)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="repair_switch")
@Table(appliesTo = "repair_switch",comment = "工单流转记录")
@Data
@EntityListeners(AuditingEntityListener.class)
public class RepairSwitch extends BaseEntity {

    @Column(name = "code", columnDefinition = "VARCHAR(64) COMMENT '工单号'")
    @NotNull(message = "工单号不能为空")
    private String code;

    @Column(name = "pre_user_id", columnDefinition = "BIGINT COMMENT '上一个处理人'")
    @NotNull(message = "上一个处理人未关联")
    private Long preUserId;

    @Column(name = "next_user_id", columnDefinition = "BIGINT COMMENT '下一个处理人'")
    @NotNull(message = "下一个处理人关联")
    private Long nextUserId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "switch_time",columnDefinition="DATETIME COMMENT '流转时间'")
    private Date switchTime;
}
